#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>





int main(int argc, char**argv)
{

	AVFormatContext *fmt_ctx = NULL;
	AVPacket pkt;
	int ret = 0;

	if(argv[1] == NULL)
	{
		printf("Usage %s filename\n",argv[0]);
		return -1;
	}

	av_register_all();
	if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)) < 0) {
		av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
		return ret;
	}   

	if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
		av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
		return ret;
	}

	for(;;)
	{	
		if( ( ret = av_read_frame(fmt_ctx, &pkt) ) )
		{
			av_log(NULL, AV_LOG_ERROR, "Unable to read frame\n");
			return ret;

		}
		printf("frame size %d\n",pkt.size);
	}


}
